library(parallel)
library(data.table)
library(ggplot2)
################################################################
### Debugging and exploring the stochastic volatility model ###
################################################################
# Does separate runs produce differing predictions?
aa <- Sys.time()
barttest <- mclapply(
rep(1, 4),
bikes_bart,
agc = list(1, 600, FALSE),
nrep = 50000,
nburn = 5000,
mc.cores = 4
)
Sys.time() - aa
all_bart <- rbindlist(barttest, idcol = "run")
head(all_bart)
saveRDS(all_bart, "temp-bikes/01 Agents/all_bart.Rds")
# In case something goes horribly wrong
all_bart$run <- as.factor(all_bart$run)
all_bart[all_bart$t == 667, "lpdens"] <- 0
ggplot(all_bart, aes(x = t, y = lpdens, col = run)) +
geom_line() +
labs(title = "Lpdens of multiple runs of BART")
ggsave("temp-bikes/01 Agents/compare_bart.pdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.